//
//  CCClippingSkeletalSprite.h
//  BattleEmpireTest
//
//  Created by droidhang on 13-7-2.
//
//

#ifndef __BattleEmpireTest__CCClippingSkeletalSprite__
#define __BattleEmpireTest__CCClippingSkeletalSprite__

#include "CCSkeletalSprite.h"

NS_CC_BEGIN

class CCClippingSkeletalSprite : public CCSkeletalSprite {
    
public:
    virtual ~CCClippingSkeletalSprite();
    
    //vt: 1 means need cclipping, 0 means don't need / and  be careful set vt
    static CCClippingSkeletalSprite* create(const char* key,CCClippingNode* clipper,const vector<bool>& bvt,CCSprite* sprtAntialias=nullptr);
    
    static CCClippingSkeletalSprite* create(CCSkeleton* s,CCClippingNode* clipper,const vector<bool>& bvt,CCSprite* sprtAntialias=nullptr);
    
    bool init(CCClippingNode* clipper,const vector<bool>& bvt,CCSprite* sprtAntialias=nullptr);
    
    virtual void setShaderProgram(CCGLProgram* pShaderProgram);
    
    void setScaleForSkeletalSprite(float scale);
    
protected:
    CCClippingSkeletalSprite();
    
    virtual void createSprites(CCSprite* sprite,bool &lastAdditive,bool &nowAdditive);
    
private:
    
    vector<bool> _bvt;
    vector<bool>::iterator _iter;
    
    int _count;
};

NS_CC_END

#endif /* defined(__BattleEmpireTest__CCClippingSkeletalSprite__) */
